package com.wu.store.common.util;

import lombok.Data;

import java.io.Serializable;

@Data
public class MessageEntity implements Serializable {
	private boolean success;
	private Object data;
	private String message;

	public boolean getSuccess(){
		return success;
	}

	public MessageEntity(){
		this.success = false;
	}
	public MessageEntity(Builder builder) {
		this.success = builder.success;
		this.data = builder.data;
		this.message = builder.message;
	}

	public static class Builder {
		private boolean success = false;
		private Object data;
		private String message;

		public Builder success(boolean success) {
			this.success = success;
			return this;
		}

		public Builder message(String message) {
			this.message = message;
			return this;
		}

		public Builder data(Object data) {
			this.data = data;
			return this;
		}

		public MessageEntity create() {
			return new MessageEntity(this);
		}
	}
}
